_author__ = 'Shawn,Tan'
__all__ = ["ialu", "halu", "dalu", "falu", "bcu", "bru", "cvt", "cvt64", "lsu", "misc", "ib", "mma", "syncop", "xu", "udp"]

import sys
import inspect
import importlib

def dynamic_import(module):
    return importlib.import_module("."+module, __name__)

def get_class_in_module():
    classes = {}

    for cl in __all__:
      mod = dynamic_import(cl)
      for name, _class in inspect.getmembers(mod, inspect.isclass):
          if name != "ISA_BASE" and name != "Logger":
             obj = _class()
             classes[obj.__class__.__name__] = _class
    return classes

def get_functions_in_class(_class):
    
    obj = _class()
    for name, function in inspect.getmembers(_class, predicate=inspect.isroutine):
        if "__" not in name and "getFile" != name and "setFile" != name and "info" != name:
           obj.opcodes[name] = function
    
    return obj

isa_lists=get_class_in_module()
            